import 'package:flutter/material.dart';

extension BoxTopBorderExtension on Widget {
  Widget xh_topBorder(
          {double? width,
          double? height,
          Color? borderColor = Colors.black,
          double? borderWith = 1,
          Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(
              color: color,
              border: Border(top: BorderSide(color: borderColor!, width: borderWith!))),
          child: this);
}

extension BoxBottomBorderExtension on Widget {
  Widget xh_bottomBorder(
          {double? width,
          double? height,
          Color? borderColor = Colors.black,
          double? borderWith = 1,
          Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(
              color: color,
              border: Border(bottom: BorderSide(color: borderColor!, width: borderWith!))),
          child: this);
}

extension BoxLeftBorderExtension on Widget {
  Widget xh_leftBorder(
          {double? width,
          double? height,
          Color? borderColor = Colors.black,
          double? borderWith = 1,
          Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(
              color: color,
              border: Border(left: BorderSide(color: borderColor!, width: borderWith!))),
          child: this);
}

extension BoxRightBorderExtension on Widget {
  Widget xh_rightBorder(
          {double? width,
          double? height,
          Color? borderColor = Colors.black,
          double? borderWith = 1,
          Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(
              color: color,
              border: Border(right: BorderSide(color: borderColor!, width: borderWith!))),
          child: this);
}

extension BoxBorderAllExtension on Widget {
  Widget xh_borderAll(
          {double? width,
          double? height,
          Color? borderColor = Colors.black,
          double? borderWith = 1,
          Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(
              color: color, border: Border.all(color: borderColor!, width: borderWith!)),
          child: this);
}

extension BoxBorderTopRaduisExtension on Widget {
  Widget xh_topBorderRaduis(
          {double? width, double? height, required double radius, Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(
              color: color,
              borderRadius: BorderRadius.only(
                topLeft: Radius.circular(radius),
                topRight: Radius.circular(radius),
              )),
          child: this);
}

extension BoxBorderBottomRaduisExtension on Widget {
  Widget xh_bottomBorderRaduis(
          {double? width, double? height, required double radius, Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(
              color: color,
              borderRadius: BorderRadius.only(
                bottomLeft: Radius.circular(radius),
                bottomRight: Radius.circular(radius),
              )),
          child: this);
}

extension BoxBorderRaduisExtension on Widget {
  Widget xh_borderRaduis(
          {double? width,
          double? height,
          required double topLeft,
          required double topRight,
          required double bottomLeft,
          required double bottomRight,
          Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(
              color: color,
              borderRadius: BorderRadius.only(
                topLeft: Radius.circular(topLeft),
                topRight: Radius.circular(topRight),
                bottomLeft: Radius.circular(bottomLeft),
                bottomRight: Radius.circular(bottomRight),
              )),
          child: this);

  Widget xh_borderRaduisAll(
          {double? width, double? height, required double radius, Color? color}) =>
      Container(
          width: width,
          height: height,
          decoration: BoxDecoration(color: color, borderRadius: BorderRadius.circular(radius)),
          child: this);
}
